]> git.r.bdr.sh - rbdr/Flat-Bezel.qsplugin/blame_incremental - Flat Bezel/BackgroundView.swift
Prep version 1.1.0
[rbdr/Flat-Bezel.qsplugin] / Flat Bezel / BackgroundView.swift
... / ...
CommitLineData
1import Foundation
2import Cocoa
3
4class BackgroundView: QSBezelBackgroundView {
5
6 override func draw(_ rect: NSRect) {
7 let boundsRect = bounds
8
9 let roundRect = NSBezierPath()
10 roundRect.appendRoundedRect(boundsRect, xRadius: 8.0, yRadius: 8.0)
11 roundRect.addClip()
12
13 let darkMode = effectiveAppearance.name == .darkAqua
14 if (darkMode) {
15 NSColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 0.99).setFill()
16 } else {
17 NSColor(red: 1, green: 1, blue: 1, alpha: 0.99).setFill()
18 }
19 boundsRect.fill(using: .copy)
20
21 super.draw(boundsRect)
22 }
23}